<?php

namespace app\api\controller;

use app\common\controller\Api;

/**
 * 分类 标签 接口
 */
class Allclass extends Api
{

    protected $noNeedLogin = ["*"];
    // 无需鉴权的接口,*表示全部
    protected $noNeedRight = ['*'];

    //protected $classList = [];

    // 获取所有分类
    //http://域名/api/Allclass/list
    public function list()
    {
        //分类
        $classList = ['0'=>["id"=> 0,"pid"=> 0,"name"=> "全部","createtime"=> 1691256230,"updatetime"=> 1691256230,"image"=> null,"status"=> 0]];
        $classList2 = model('\app\admin\model\allclass\Allclass')->getClassList();

        foreach($classList as $key=>$value){
            array_unshift($classList2,$value);
        }

        $this->success('成功',$classList2);
    }

}
